package com.biz.primus.management.coupon.type.degraded;

import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.management.coupon.type.feign.CouponTypeFeignClient;
import com.biz.primus.model.coupon.vo.couponType.CouponTypeDetailVo;
import com.biz.primus.model.coupon.vo.couponType.CouponTypeVo;
import java.util.Collections;
import java.util.List;
import org.springframework.stereotype.Component;

/**
 * 优惠券类型Feign Client服务降级
 *
 * @author david-liu
 */
@Component
public class DegradedCouponTypeFeignClient implements CouponTypeFeignClient {
    @Override
    public Boolean createCouponType(CouponTypeVo couponTypeVo) {
        return Boolean.FALSE;
    }

    @Override
    public SpringPageVO<CouponTypeDetailVo> listCouponTypes(String name, int page, int pageSize) {
        List<CouponTypeDetailVo> content = Collections.emptyList();
        SpringPageVO<CouponTypeDetailVo> springPageVO = new SpringPageVO<>();
        springPageVO.setContent(content);
        springPageVO.setNumber(0);
        return SpringPageVO.<CouponTypeDetailVo>builder().build();
    }
}
